import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:winkai/res/app_colors.dart';
import 'package:winkai/res/dimens.dart';
import 'package:winkai/ui/user/controller/user_details_controller.dart';
import 'package:winkai/utils/image_utils.dart';
import 'package:winkai/widget/custom_style_bg.dart';
import 'package:winkai/widget/normal_action_widget.dart';

class UserDetailsActionWidget extends StatelessWidget {
  const UserDetailsActionWidget({
    super.key,
    required this.controller,
  });

  final UserDetailsController controller;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(
          left: Dimens.mainHorizontalSpacing,
          right: Dimens.mainHorizontalSpacing,
          top: 40.w,
          bottom: 40.w),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          CustomStyleBg(
            color: Colors.white,
            borderRadius: 16,
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                NormalActionWidget(
                  actionName: 'user_clear_history'.tr,
                  onTap: () {
                    controller.cleanMsg();
                  },
                ),
                Divider(
                  height: 0.5.w,
                  thickness: 0.5.w,
                  indent: Dimens.mainHorizontalSpacing,
                  endIndent: Dimens.mainHorizontalSpacing,
                  color: AppColors.color_ed,
                ),
                NormalActionWidget(
                  actionName: 'user_report'.tr,
                  onTap: () {
                    controller.reportUser();
                  },
                ),
              ],
            ),
          ),
          SizedBox(height: 20.w),
          GestureDetector(
            onTap: () {
              controller.deleteMsg();
            },
            behavior: HitTestBehavior.translucent,
            child: CustomStyleBg(
              color: Colors.white,
              borderRadius: 16,
              height: 50.w,
              alignment: Alignment.center,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  ImageUtils.getImage('ic_ai_delete_red', 20.w, 20.w),
                  SizedBox(width: 8.w),
                  Text(
                    'user_delete_chat'.tr,
                    style: TextStyle(
                      fontSize: 14.sp,
                      fontWeight: FontWeight.w500,
                      color: const Color(0xffEE5065),
                    ),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
